<div ng-include src="'tpl/public/header.html?1'"></div>
<div class="contents">
    <ol class="breadcrumb">
        <li>
            <a href="#/index/panel">首页</a>
        </li>
        <li class="active">{{pathText}}</li>
    </ol>
    <span ng-if="product.outProductId">外场</span>
    <form class="form-horizontal" role="form" name="form" novalidate ng-submit="save()">

        <input type="hidden" ng-model="product.outProductId">
        <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <span  class="col-sm-1">
                <input type="checkbox" ng-model="product.flagZhiding">置顶</span>
            <span class="col-sm-1">
                <input type="checkbox" ng-model="product.flagBaoxiao">包销</span>
            <span class="col-sm-1">
                <input type="checkbox" ng-model="product.flagZhutui">主推</span>
        </div>
        <div class="form-group" ng-class="{'has-error':form.pName.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                产品简称
            </label>
            <div class="col-sm-5">
                <input type="text" class="form-control" autocomplete="off" value="" name="pName" ng-model="product.pName" required="required" placeholder="产品简称"></div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.pFullName.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                产品全称
            </label>
            <div class="col-sm-5">
                <input type="text" class="form-control" autocomplete="off" value="" name="pFullName" ng-model="product.pFullName" required="required" placeholder="产品全称"></div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.pInvestOwner.$invalid}">
            <label class="col-sm-2 control-label">发行机构</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="pInvestOwner" ng-model="product.pInvestOwner" placeholder="发行机构"></div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">发行地区</label>
            <div class="col-sm-5">
                <select class="form-control" name="pPublicArea" ng-model="product.pPublicArea" ng-options="m.value as m.text for m in pPublicAreaModel" placeholder="发行地区"></select>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.pAllIssuingScale.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                发行规模
            </label>
            <div class="col-sm-5">
                <input type="number" class="form-control" autocomplete="off" value="" name="pAllIssuingScale" ng-model="product.pAllIssuingScale" required="required" placeholder="发行规模,请填写数字，单位亿元">
                <span class="form-control-feedback">亿元</span>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.pPublicArea.$invalid}">
            <label class="col-sm-2 control-label">投资方向</label>
            <div class="col-sm-5">
                <select class="form-control" name="pPublicArea" ng-model="product.pPublicArea" ng-options="m.value as m.text for m in pPublicAreaModel" placeholder="投资方向"></select>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.pSaleTimeStartStr.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                起售时间
            </label>
            <div class="col-sm-5">
                <input type="date" class="form-control" autocomplete="off" value="" name="pSaleTimeStartStr" ng-model="product.pSaleTimeStartStr" required="required" placeholder="起售时间,格式如2014-09-01" ng-pattern="/^\d{4}-\d{2}-\d{2}$/"></div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.pMinimumAmountTmp.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                产品起购金额
            </label>
            <div class="col-sm-5">
                <input type="number" class="form-control" autocomplete="off" value="" name="pMinimumAmount" ng-model="product.pMinimumAmountTmp" placeholder="产品起购金额,请填写数字,单位万元">
                <span class="form-control-feedback">万元</span>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.pProgressiveAmount.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                累进追加金额最小值
            </label>
            <div class="col-sm-5">
                <input type="number" class="form-control" autocomplete="off" value="" name="pProgressiveAmount" ng-model="product.pProgressiveAmountTmp" placeholder="累进追加金额最小值,请填写数字，单位万元">
                <span class="form-control-feedback">万元</span>
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.pDueTime.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                产品期限
            </label>
            <div class="col-sm-5">
                <input type="number" class="form-control" autocomplete="off" value="" name="pDueTime" ng-model="product.pDueTime" required="required" placeholder="产品期限,请填写数字,单位月">
                <span class="form-control-feedback">月</span>
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.tjzl.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                提交资料
            </label>
            <div class="col-sm-5">
                <label ng-repeat="tjzlitem in dictMap.tjzlModel">
                    <input type="checkbox" name="tjzl" ng-model="allTjzls[tjzlitem.value]" value="{{tjzlitem.value}}">{{tjzlitem.text}}</label>
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.pPublicArea.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>    
                付利方式
            </label>
            <div class="col-sm-5">
                <select class="form-control" name="pPublicArea" ng-model="product.pPublicArea" ng-options="m.value as m.text for m in pPublicAreaModel"  placeholder="发行地区"></select>
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.pEndEarlyIdentification.$invalid}">
            <label class="col-sm-2 control-label">项目是否可以提前结束</label>
            <div class="col-sm-5">
                <select class="form-control" name="pEndEarlyIdentification" ng-model="product.pEndEarlyIdentification" ng-options="m.value as m.text for m in dictMap['pEndEarlyIdentification']"></select>
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.tjzl.$invalid}">
            <label class="col-sm-2 control-label">
                融资方
            </label>
            <div class="col-sm-5">
                    <input type="text" class="form-control" name="tjzl" ng-model="allTjzls[tjzlitem.value]" value="{{tjzlitem.value}}">
            </div>
        </div>

        <!--产品供应方公司，新加-->
        <div class="form-group" ng-class="{'has-error':form.pAccessId.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                产品供应方公司
            </label>
            <div class="col-sm-5">
                <select class="form-control" name="pAccessId" ng-model="product.pAccessId" ng-options="m.id as m.accessCompany for m in supplierListOfProduct" required="required" ng-change="onSelectChange()" placeholder="产品供应方公司"></select>
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.pAccessId.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                对接人
            </label>
            <div class="col-sm-5">
                <input type="text" class="form-control" readonly value="{{accessNameOfCompany}}" placeholder="对接人"></div>
        </div>
    </form>
</div>